<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="js/select2/select2.css" />
	<style type="text/css">
		body{
			background-image:url(img/bg8.jpg);
			padding-top:50px;
		}
	</style>
</head>
<body class="body">
	<div class="navbar navbar-fixed-top">
		<%@include file="include/top.jsp" %>
		
		<div class="container">
			<div class="row">
				<div class="span10">
					<form class="form-horizontal" action="logic.jspx?m=new_project" method="post" id="myform">
						<fieldset>
							<legend>开始一个新项目</legend>
							<div class="control-group">
								<label for="" class="control-label">项目名称</label>
								<div class="controls">
									<input type="text" name="proName" class="span4"/>
								</div>
							</div>
							
							<div class="control-group">
								<label for="" class="control-label">项目描述</label>
								<div class="controls">
									<textarea name="describe" id="" rows="6" class="span5"></textarea>
								</div>
							</div>
							
							<div class="control-group">
								<label for="multiSelect" class="control-label">负责人</label>
								<div class="controls">
									<select name="manager" class="multiSelect" style="width:200px">
										<option></option>
										<c:forEach items="${userlist}" var="u">
											<option value="${u.id }">${u.username }</option>
										</c:forEach>											
																					 
									</select>
								</div>
							</div>
							
							<div class="control-group">
								<label for="" class="control-label">项目成员</label>
								<div class="controls">
									<select name="worker" id="worker" multiple class="multiSelect" style="width:400px">
										
										<c:forEach items="${userlist}" var="u">
											<option value="${u.id }">${u.username }</option>
										</c:forEach>											
																					 
									</select>
								</div>
							</div>
							<input type="hidden" name="workers" id="workers">
							<div class="form-actions" style=background-color:#FFF;>
								<button id="btnsave" class="btn btn-primary">保存</button>
								<button class="btn btn-danger"><a href = "main.jspx">返回</a></button>
							</div>
							
						</fieldset>
					
					</form>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/select2/select2.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$(".multiSelect").select2();
			$("#btnsave").click(function(){
				var v = $("#worker").select2("val");
				$("#workers").val(v);
				$("#myform").submit();
			});
		});
	</script>
	
	
</body>
</html>